/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主要内容区域 */
main {
    flex: 1;
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 2rem;
}

/* 添加任务区域 */
.add-task-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.add-task-section h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

#taskInput {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#taskInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.4);
}

/* 任务列表区域 */
.tasks-section h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.task-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.task-stats span {
    background: #f7fafc;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.task-list {
    list-style: none;
}

.task-item {
    background: #f8f9fa;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.task-item:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.task-item.completed {
    background: #f0fff4;
    border-left-color: #48bb78;
    opacity: 0.8;
}

.task-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-text {
    font-size: 1.1rem;
    color: #2d3748;
}

.task-text.completed {
    text-decoration: line-through;
    color: #718096;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #718096;
}

.empty-state p {
    font-size: 1.2rem;
}

/* 底部 */
footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    padding: 1rem;
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 1.5rem;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    #taskInput {
        min-width: 100%;
    }
    
    .task-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .task-actions {
        align-self: flex-end;
    }
}